home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / fire_it_.swf / scripts / __Packages / #5.as < prev    next >
Encoding:
Text File  |  2011-03-26  |  12.6 KB  |  459 lines

  1. class ┬º#5┬º
  2. {
  3.    static var ┬º#3┬º = false;
  4.    static var ┬º#249┬º = true;
  5.    static var ┬º#446┬º = false;
  6.    static var ┬º#364┬º = false;
  7.    var ┬º#122┬º = 1;
  8.    var ┬º#150┬º = 2;
  9.    var ┬º#145┬º = 3;
  10.    var ┬º#152┬º = 4;
  11.    static var ┬º#81┬º = 15636787;
  12.    static var ┬º#291┬º = 16724736;
  13.    static var ┬º#200┬º = 52224;
  14.    var ┬º#52┬º = 2;
  15.    var ┬º#36┬º = 0;
  16.    var ┬º#178┬º = 0;
  17.    var ┬º#7┬º = 1;
  18.    var ┬º#56┬º = 2;
  19.    var ┬º#342┬º = 4;
  20.    var ┬º#328┬º = 5;
  21.    var ┬º#414┬º = 3;
  22.    var level = 0;
  23.    var ┬º#134┬º = false;
  24.    var ┬º#356┬º = false;
  25.    static var scale = 1;
  26.    var ┬º#355┬º = [];
  27.    var ┬º#243┬º = [0.5,0.75,1.166667,1.583333,2.083333];
  28.    var ┬º#340┬º = false;
  29.    var ┬º#297┬º = false;
  30.    function ┬º#5┬º()
  31.    {
  32.       if(eval("#5")["#3"])
  33.       {
  34.          _root.createEmptyMovieClip("fps",1000);
  35.          _root.fps.loadMovie("#462.swf");
  36.       }
  37.       _quality = "#464";
  38.       Stage.showMenu = false;
  39.       eval("#5").scale = _root.background._width / 702;
  40.       if(eval("#5")["#3"])
  41.       {
  42.          eval("#0").log("width: " + _root.background._width + ", game scale: " + eval("#5").scale);
  43.       }
  44.       this["#138"] = eval("#1").getInstance();
  45.       this["#138"].setupButtons(_root["#72"],_root["#71"]);
  46.       this["#36"] = getTimer();
  47.       this["#178"] = this["#36"];
  48.       this["#8"](this["#122"]);
  49.       this["#102"] = new ┬º#37┬º();
  50.       this.bonusX2 = new ┬º#68┬º("bonusX2","x2",142 * eval("#5").scale,21 * eval("#5").scale,-100);
  51.       this.bonusX3 = new ┬º#68┬º("bonusX3","x3",152 * eval("#5").scale,21 * eval("#5").scale,-110);
  52.       this.bonusX5 = new ┬º#68┬º("bonusX5","x5",162 * eval("#5").scale,21 * eval("#5").scale,-120);
  53.       this.bonusDisplay = new ┬º#68┬º("bonusBonus","bonus",143 * eval("#5").scale,30 * eval("#5").scale,-130);
  54.       _root["#327"] = true;
  55.       _root.onEnterFrame = this["#393"];
  56.       if(eval("#5")["#3"])
  57.       {
  58.          eval("#0").log(this["#2"]() + "created game, player id: " + this["#56"] + ", bounds: " + Bounds.toString());
  59.       }
  60.    }
  61.    function ┬º#2┬º()
  62.    {
  63.       return "Game s" + this["#7"] + " l" + this.level + ":  ";
  64.    }
  65.    function ┬º#393┬º()
  66.    {
  67.       _root["#4"]["#383"]();
  68.    }
  69.    function ┬º#82┬º()
  70.    {
  71.       this["#52"] = 0;
  72.       this["#355"] = [];
  73.       this["#199"] = 0;
  74.       this["#44"] = 0;
  75.       this.level = 0;
  76.       this["#112"] = 0;
  77.       this["#326"] = 0;
  78.       this["#413"] = 0;
  79.       this["#356"] = false;
  80.       this["#185"]();
  81.       _root["#35"]["#8"](this["#35"]["#33"]);
  82.       this["#191"] = 0;
  83.       this["#297"] = false;
  84.       this["#59"] = false;
  85.       _root.onFire.gotoAndStop("#142");
  86.       _root["#278"].gotoAndStop("#142");
  87.       this["#102"] = new ┬º#37┬º();
  88.    }
  89.    function ┬º#45┬º()
  90.    {
  91.       this["#9"]["#135"]();
  92.       this["#134"] = false;
  93.       this.bonusX2.hide();
  94.       this.bonusX3.hide();
  95.       this.bonusX5.hide();
  96.       this.bonusDisplay.hide();
  97.    }
  98.    function ┬º#394┬º()
  99.    {
  100.       this["#199"] = this["#199"] + 1;
  101.       this["#44"] = 0;
  102.       this["#52"] -= 0.08333333333333333;
  103.       if(_root["#24"]["#203"]())
  104.       {
  105.          this["#102"]["#271"](false,0);
  106.          _root["#24"]["#147"]();
  107.       }
  108.       else if(eval("#37")["#3"])
  109.       {
  110.          var _loc3_ = "miss from outside shot point";
  111.          _root["#143"].text = _loc3_;
  112.          eval("#0").log(this["#2"]() + _loc3_);
  113.       }
  114.       if(!_root["#24"]["#163"]())
  115.       {
  116.          _root["#18"]["#8"](_root["#18"]["#61"]);
  117.       }
  118.       this["#9"]["#135"]();
  119.    }
  120.    function getPlayerNetDistance()
  121.    {
  122.       var _loc4_ = this["#9"]._x - _root["#35"]._x;
  123.       var _loc3_ = this["#9"]._y - _root["#35"]._y;
  124.       var _loc9_ = Math.round(Math.sqrt(_loc4_ * _loc4_ + _loc3_ * _loc3_));
  125.       var _loc6_ = Bounds.getXMin() - _root["#35"]._x;
  126.       var _loc5_ = Bounds.getYMax() - _root["#35"]._y;
  127.       var _loc7_ = Math.round(Math.sqrt(_loc6_ * _loc6_ + _loc5_ * _loc5_));
  128.       var _loc8_ = 100 - Math.round((_loc7_ - _loc9_) / _loc7_ * 100);
  129.       return _loc8_;
  130.    }
  131.    function ┬º#318┬º()
  132.    {
  133.       _root["#237"].text = "";
  134.       var _loc3_ = Math.floor((getTimer() - this["#36"]) / 1000);
  135.       var _loc4_ = this["#52"] * 60 - _loc3_;
  136.       this["#9"]["#344"]();
  137.       if(this["#60"]["#236"]())
  138.       {
  139.          if(eval("#5")["#3"])
  140.          {
  141.             eval("#0").log(this["#2"]() + "hits complete");
  142.          }
  143.          _root["#4"]["#185"]();
  144.       }
  145.    }
  146.    function ┬º#185┬º()
  147.    {
  148.       if(eval("#5")["#3"])
  149.       {
  150.          eval("#0").log(this["#2"]() + "next level");
  151.       }
  152.       if(this.level > 0)
  153.       {
  154.          var _loc4_ = Math.floor((getTimer() - this["#36"]) / 1000);
  155.          var _loc3_ = this["#52"] * 60 - _loc4_;
  156.          if(_loc3_ < 0)
  157.          {
  158.             _loc3_ = 0;
  159.          }
  160.          this["#102"]["#361"](this.level,_loc3_);
  161.          this["#52"] = _loc3_ / 60 + this["#243"][this.level];
  162.       }
  163.       else
  164.       {
  165.          this["#52"] = this["#243"][this.level];
  166.       }
  167.       this["#36"] = getTimer();
  168.       this.level = this.level + 1;
  169.       var _loc6_ = Math.floor(this["#52"]);
  170.       var _loc5_ = Math.floor(this["#52"] * 60) % 60;
  171.       _root.levelDisplay.draw(this.level);
  172.       this["#60"]["#82"](5 * this.level);
  173.       _root["#24"].setScale(this.level);
  174.       if(this.level >= 6)
  175.       {
  176.          if(eval("#5")["#3"])
  177.          {
  178.             eval("#0").log(this["#2"]() + "level " + this.level + ", going to game over");
  179.          }
  180.          this.level = 5;
  181.          this["#8"](this["#152"]);
  182.       }
  183.       else
  184.       {
  185.          _root["#24"]["#246"] = 2.5 + this.level / 6;
  186.          _root.levelComplete.number.gotoAndStop(this.level);
  187.          _root.levelComplete.play();
  188.          this["#7"] = this["#150"];
  189.       }
  190.    }
  191.    function ┬º#4#286┬º()
  192.    {
  193.    }
  194.    function ┬º#8┬º(┬º#97┬º)
  195.    {
  196.       if(this["#7"] == ┬º#97┬º)
  197.       {
  198.          if(eval("#5")["#3"])
  199.          {
  200.             eval("#0").log(this["#2"]() + "already in state " + this["#7"]);
  201.          }
  202.          return undefined;
  203.       }
  204.       if(┬º#97┬º == this["#150"])
  205.       {
  206.          if(eval("#5")["#3"])
  207.          {
  208.             eval("#0").log(this["#2"]() + "Switching to GAME state");
  209.          }
  210.          this["#60"] = new ┬º#137┬º(10);
  211.          this["#134"] = false;
  212.          _root.gotoAndStop("#5");
  213.          this["#82"]();
  214.          this["#36"] = getTimer();
  215.          _root["#327"] = false;
  216.          this["#9"] = _root["#370"];
  217.          this["#9"].setID(this["#56"]);
  218.          _root["#250"].setColor(eval("#5")["#81"]);
  219.          _root["#176"].setColor(eval("#5")["#81"]);
  220.          _root["#170"].setColor(eval("#5")["#81"]);
  221.          _root.levelDisplay.setColor(eval("#5")["#200"]);
  222.          this.bonusX2.show();
  223.          this.bonusX3.show();
  224.          this.bonusX5.show();
  225.          this.bonusDisplay.show();
  226.          this["#138"]["#329"](1,3000);
  227.          this["#138"]["#20"](eval("#1")["#202"]);
  228.       }
  229.       else if(┬º#97┬º == this["#122"])
  230.       {
  231.          if(eval("#5")["#3"])
  232.          {
  233.             eval("#0").log(this["#2"]() + "Switching to MENU state");
  234.          }
  235.          this["#340"] = false;
  236.          this["#45"]();
  237.       }
  238.       else if(┬º#97┬º == this["#152"])
  239.       {
  240.          if(eval("#5")["#3"])
  241.          {
  242.             eval("#0").log(this["#2"]() + "Switching to OVER state");
  243.          }
  244.          _root.gotoAndStop("#286");
  245.          this["#138"]["#261"](3000);
  246.          this["#102"]["#357"]();
  247.          this["#45"]();
  248.       }
  249.       this["#7"] = ┬º#97┬º;
  250.    }
  251.    function score()
  252.    {
  253.       if(_root["#11"]["#206"])
  254.       {
  255.          eval("#1").getInstance()["#20"](eval("#1")["#251"]);
  256.       }
  257.       else
  258.       {
  259.          eval("#1").getInstance()["#20"](eval("#1")["#252"]);
  260.       }
  261.       _root["#35"]["#8"](_root["#35"]["#164"]);
  262.       if(!_root["#24"]["#203"]())
  263.       {
  264.          if(eval("#37")["#3"])
  265.          {
  266.             var _loc3_ = "score from outside shot point";
  267.             _root["#143"].text = _loc3_;
  268.             eval("#0").log(this["#2"]() + _loc3_);
  269.          }
  270.          this["#44"] = 0;
  271.          this["#9"]["#135"]();
  272.          _root["#18"]["#8"](_root["#18"]["#61"]);
  273.          return undefined;
  274.       }
  275.       this["#199"] = 0;
  276.       this["#44"] = this["#44"] + 1;
  277.       this["#102"]["#271"](true,this["#44"]);
  278.       _root["#24"]["#147"]();
  279.       if(this["#44"] == 5)
  280.       {
  281.          _root.onFire.play();
  282.       }
  283.       if(this["#44"] == 15)
  284.       {
  285.          _root["#278"].play();
  286.          _root["#193"]["#254"]("You\'re on a streak!");
  287.       }
  288.       if(this["#44"] >= 5)
  289.       {
  290.          this["#9"]["#307"]();
  291.          _root["#18"]["#8"](_root["#18"]["#233"]);
  292.       }
  293.       else
  294.       {
  295.          _root["#18"]["#8"](_root["#18"]["#90"]);
  296.       }
  297.    }
  298.    function ┬º#383┬º()
  299.    {
  300.       if(this["#7"] == this["#150"] || this["#7"] == this["#145"])
  301.       {
  302.          if(!this["#134"])
  303.          {
  304.             _root["#24"]["#147"]();
  305.             this["#134"] = true;
  306.          }
  307.          this["#349"]();
  308.          if(this["#9"].hitTest(_root["#24"]))
  309.          {
  310.             _root["#24"]["#8"](_root["#24"]["#183"]);
  311.          }
  312.          else
  313.          {
  314.             _root["#24"]["#8"](_root["#24"]["#165"]);
  315.          }
  316.          _root["#193"].setVisible(true);
  317.          this["#333"]();
  318.          if(this["#191"] < getTimer() && this["#7"] == this["#145"])
  319.          {
  320.             if(eval("#5")["#3"])
  321.             {
  322.                eval("#0").log(this["#2"]() + "time up");
  323.             }
  324.             this["#185"]();
  325.          }
  326.          if(this["#338"] < getTimer() && this["#59"])
  327.          {
  328.             this.bonusDisplay["#111"]();
  329.             this.bonusX2["#111"]();
  330.             this.bonusX3["#111"]();
  331.             this.bonusX5["#111"]();
  332.             this["#59"] = false;
  333.          }
  334.          this["#9"].update(getTimer() - this["#178"]);
  335.          _root["#18"].update();
  336.          this["#60"].update();
  337.          _root["#451"].update();
  338.          this["#178"] = getTimer() - this["#36"];
  339.       }
  340.       else if(this["#7"] != this["#152"])
  341.       {
  342.          if(this["#7"] == this["#122"])
  343.          {
  344.             this["#350"]();
  345.          }
  346.       }
  347.    }
  348.    function ┬º#403┬º(n)
  349.    {
  350.       if(n == 1)
  351.       {
  352.          return "#470";
  353.       }
  354.       if(n == 2)
  355.       {
  356.          return "#471";
  357.       }
  358.       return "#454";
  359.    }
  360.    function ┬º#420┬º(┬º#426┬º)
  361.    {
  362.       return true;
  363.    }
  364.    function ┬º#333┬º()
  365.    {
  366.       var _loc6_ = Math.floor((getTimer() - this["#36"]) / 1000);
  367.       var _loc5_ = this["#52"] * 60 - _loc6_;
  368.       var _loc4_ = Math.floor(_loc5_ / 60);
  369.       var _loc3_ = Math.floor(_loc5_ - _loc4_ * 60);
  370.       if(_loc4_ < 0)
  371.       {
  372.          _loc4_ = 0;
  373.          _loc3_ = 0;
  374.       }
  375.       _root["#250"].draw(_loc4_);
  376.       if(_loc3_ <= 0)
  377.       {
  378.          _root["#176"].draw(0);
  379.       }
  380.       else
  381.       {
  382.          _root["#176"].draw(eval("#14").getDigit(_loc3_,1));
  383.       }
  384.       if(_loc3_ < 10)
  385.       {
  386.          _root["#170"].draw(0);
  387.       }
  388.       else
  389.       {
  390.          _root["#170"].draw(eval("#14").getDigit(_loc3_,2));
  391.       }
  392.       if(_loc5_ <= 0 && this["#7"] != this["#145"])
  393.       {
  394.          eval("#1").getInstance()["#20"](eval("#1")["#196"]);
  395.          if(this["#9"]["#47"])
  396.          {
  397.             this["#191"] = getTimer() + 2000;
  398.          }
  399.          else
  400.          {
  401.             this["#191"] = getTimer();
  402.          }
  403.          this["#8"](this["#145"]);
  404.       }
  405.    }
  406.    function ┬º#350┬º()
  407.    {
  408.    }
  409.    function ┬º#349┬º()
  410.    {
  411.       var _loc3_ = false;
  412.       if(Key.isDown(32) || Key.isDown(13))
  413.       {
  414.          if(!this["#9"]["#47"] && !this["#9"]["#57"] && this["#9"]["#11"]._visible)
  415.          {
  416.             _root["#4"]["#9"]["#392"]();
  417.             _loc3_ = true;
  418.             return undefined;
  419.          }
  420.       }
  421.       else
  422.       {
  423.          this["#9"]["#205#10"]();
  424.       }
  425.       if(this["#9"]["#47"])
  426.       {
  427.          return undefined;
  428.       }
  429.       if(Key.isDown(39))
  430.       {
  431.          _root["#4"]["#9"]["#351"](Key.isDown(38) || Key.isDown(40));
  432.          _loc3_ = true;
  433.       }
  434.       else if(Key.isDown(37))
  435.       {
  436.          _root["#4"]["#9"]["#368"](Key.isDown(38) || Key.isDown(40));
  437.          _loc3_ = true;
  438.       }
  439.       if(Key.isDown(38))
  440.       {
  441.          _root["#4"]["#9"]["#382"](Key.isDown(37) || Key.isDown(39));
  442.          _loc3_ = true;
  443.       }
  444.       else if(Key.isDown(40))
  445.       {
  446.          _root["#4"]["#9"]["#367"](Key.isDown(37) || Key.isDown(39));
  447.          _loc3_ = true;
  448.       }
  449.       else if(Key.isDown(27))
  450.       {
  451.          _root["#4"]["#8"](this["#152"]);
  452.       }
  453.       if(!_loc3_)
  454.       {
  455.          _root["#4"]["#9"]["#391"]();
  456.       }
  457.    }
  458. }
  459.